import request from "@/utils/request-gis";
import requestW from "@/utils/request-w";

// -------------------------------------天气-------------------------------------
// 获取管网设施评分
export function api_Weather() {
  return requestW({
    url: "https://restapi.amap.com/v3/weather/weatherInfo",
    method: "get",
    params: {
      key: "c4d8ef2d8d568c6737771842e5f9f3de",
      city: 310000,
    },
  });
}
// -------------------------------------基础设施优化管理模块-------------------------------------
// 获取管网设施评分
export function api_GetPipeNetWorkGrade() {
  return request({
    url: "/api/infrastructure/pipe-net-work-grade",
    method: "get",
  });
}
// 获取建设年代占比
export function api_GetConstructionPeriodProportion() {
  return request({
    url: "/api/infrastructure/construction-period-proportion",
    method: "get",
  });
}
// 获取管线占比
export function api_GetMaintenanceProportion(data) {
  return request({
    url: "/api/infrastructure/maintenance-proportion",
    method: "get",
    params: data,
  });
}
// 获取维修率占比
export function api_GetMaintenanceRateProportion() {
  return request({
    url: "/api/infrastructure/maintenance-rate-proportion",
    method: "get",
  });
}

// 获取维修率TOP10
export function api_GetMaintenanceRateProportionTop() {
  return request({
    url: "/api/infrastructure/maintenance-rate-proportion-top",
    method: "get",
  });
}

// 获取水表服役情况
export function api_GetUsage() {
  return request({
    url: "/api/infrastructure/usage",
    method: "get",
  });
}
// 获取水质监测
export function api_GetWaterQualityMonitoring(factoryid: Number) {
  return request({
    url: "/api/infrastructure/water-quality-monitoring/" + factoryid,
    method: "get",
  });
}
// 获取供水量
export function api_GetWaterSupplyVolume(year: String) {
  return request({
    url: "/api/infrastructure/water-supply-volume/" + year,
    method: "get",
  });
}
// 获取日用水量
export function api_GetDailyWaterConsumption(year: String) {
  return request({
    url: "/api/infrastructure/daily-water-consumption/" + year,
    method: "get",
  });
}
// 获取进出水量
export function api_GetInAndOutWater(year: String) {
  return request({
    url: "/api/infrastructure/in-and-out-water/" + year,
    method: "get",
  });
}

// 获取制水量
export function api_GetProductionCapacityWater(year: String) {
  return request({
    url: "/api/infrastructure/production-capacity-water/" + year,
    method: "get",
  });
}

// 获取能耗药耗
export function api_GetDrugConsumption(data: any) {
  return request({
    url: "/api/infrastructure/drug-consumption/" + data,
    method: "get",
  });
}

// 获取电耗
export function api_GetEnergyConsumption(data: any) {
  return request({
    url: "/api/infrastructure/energy-consumption",
    method: "get",
    params: data,
  });
}

// -------------------------------------营销优化管理-------------------------------------
export function api_GetMarketingOptData(data: Object) {
  return request({
    url: "/api/marketing-opt/data",
    method: "get",
    params: data,
  });
}
